Ultrasensitive magnetometer using a single atom