Energy of free and bound excitons in GaAs in a magnetic field