We present the results of a variational Monte Carlo calculation of the exchange-correlation energy for a spin-polarized two-dimensional electron gas in a perpendicular magnetic field. These energies are a necessary input to the recently developed current-density functional theory. Landau-level mixing is included in a variational manner, which gives the energy at finite density at finite field, in contrast to previous approaches. Results are presented for the exchange-correlation energy and excited-state gap at $\nu =$ 1/7, 1/5, 1/3, 1, and 2. We parameterize the results as a function of $r_s$ and $\nu$ in a form convenient for current-density functional calculations.