The algebra of Wick polynomials of a scalar field on a Riemannian manifold