Exciton photoluminescence in ultrapure GaAs (total shallow impurity concentration ND approximately 1012 cm-3) was studied in magnetic fields up to 20 T. The observed magnetic field enhancement of free-exciton luminescence and exciton cooling were found to depend strongly on the excitation energy, giving direct evidence for the role of hot photoexcited electrons. The observed effect in fact reflects cooling of electrons in a magnetic field due to their increasing acoustic phonon energy relaxation rate and an efficient exciton-electron interaction. In a magnetic field parallel to the sample surface a suppression of the exciton-electron interaction was found because of the spatial separation of excitons and electrons.