A gas cloud shrinks due to gravitational forces. The gas gets hotter because the velocity (hence kinetic energy) of the gas particles gets larger. At the same time the potential energy gets smaller because the gas particles are closer to each other. Once you get past the fact that the decrease in potential energy is greater than the increase in kinetic energy (hence the gas gets hotter even though the total energy decreases), the next question is this: what happens to the lost energy? Can this question be answered without resorting to GR?