Here is a FAQ entry I wrote for physicsforums.
How does conservation of energy work in general relativity, and how does this apply to cosmology? What is the total mass-energy of the universe?
Conservation of energy doesn't apply to cosmology. General relativity doesn't have a conserved scalar mass-energy that can be defined in all spacetimes.[MTW] There is no standard way to define the total energy of the universe (regardless of whether the universe is spatially finite or infinite). There is not even any standard way to define the total mass-energy of the observable universe. There is no standard way to say whether or not mass-energy is conserved during cosmological expansion.
Note the repeated use of the word "standard" above. To amplify further on this point, there is a variety of possible ways to define mass-energy in general relativity. Some of these (Komar mass, ADM mass [Wald, p. 293], Bondi mass [Wald, p. 291]) are valid tensors, while others are things known as "pseudo-tensors" [Berman 1981]. Pseudo-tensors have various undesirable properties, such as coordinate-dependence.[Weiss] The tensorial definitions only apply to spacetimes that have certain special properties, such as asymptotic flatness or stationarity, and cosmological spacetimes don't have those properties. For certain pseudo-tensor definitions of mass-energy, the total energy of a closed universe can be calculated, and is zero.[Berman 2009] This does not mean that "the" energy of the universe is zero, especially since our universe is not closed.
One can also estimate certain quantities such as the sum of the rest masses of all the hydrogen atoms in the observable universe, which is something like 10^54 kg. Such an estimate is not the same thing as the total mass-energy of the observable universe (which can't even be defined). It is not the mass-energy measured by any observer in any particular state of motion, and it is not conserved.
MTW: Misner, Thorne, and Wheeler, Gravitation, 1973. See p. 457.
Berman 1981: M. Berman, unpublished M.Sc. thesis, 1981.
Berman 2009: M. Berman, Int J Theor Phys, http://www.springerlink.com/content/357757q4g88144p0/
Weiss and Baez, "Is Energy Conserved in General Relativity?," http://math.ucr.edu/home/baez/physics/Relativity/GR/energy_gr.html
Wald, General Relativity, 1984