Magnetic field dependence of terahertz emission from an optically excited GaAs p-i-n diode