A rocket is launched with an initial mass $m_0$. As the engines use up the fuel and eject the exhaust gasses, the rocket gradually loses mass as $m(t) = m_0(1 - kt)$, where $k$ is a constant.

Assuming the rocket rises with a constant velocity, $v$, from the surface of the Earth (radius $R$, mass $M$) to a distance $r$ from the Earth's center, how much work must the rocket engines do against gravity?