Closed hypersurfaces with prescribed Weingarten curvature in Riemannian manifolds