The magnet system of the Relativistic Heavy Ion Collider (RHIC)