Effect of a transverse magnetic field on the generation of electron beams in the gas-filled diode