Magnetic System of a Sub-Gigawatt Free-Electron Laser of the Terahertz Range Based on a Kiloampere Beam of Relativistic Electrons