The magnetic field of the helium-weak star 3 Scorpii