Generation of a modulated intense relativistic electron beam with a frequency tunable by a magnetic field