This paper presents a study of the energetics of the dayside ionosphere of Mars using models and data from several instruments on board the Mars Atmosphere and Volatile EvolutioN spacecraft. In particular, calculated photoelectron fluxes are compared with suprathermal electron fluxes measured by the Solar Wind Electron Analyzer, and calculated electron temperatures are compared with temperatures measured by the Langmuir Probe and Waves experiment. The major heat source for the thermal electrons is Coulomb heating from the suprathermal electron population, and cooling due to collisional rotational and vibrational CO2 dominates the energy loss. The models used in this study were largely able to reproduce the observed high topside ionosphere electron temperatures (e.g., 3000 K at 300 km altitude) without using a topside heat flux when magnetic field topologies consistent with the measured magnetic field were adopted. Magnetic topology affects both suprathermal electron transport and thermal electron heat conduction. The effects of using two different solar irradiance models were also investigated. In particular, photoelectron fluxes and electron temperatures found using the Heliospheric Environment Solar Spectrum Radiation irradiance were higher than those with the Flare Irradiance Spectrum Model-Mars. The electron temperature is shown to affect the O2 + dissociative recombination rate coefficient, which in turn affects photochemical escape of oxygen from Mars.