A massive helium star with a sufficiently strong magnetic field to form a magnetar