Choose R such that about 1/10th of the current required by the relay coil will be drawn by the base (note that many of these hall effect sensors are limited to about -20 mA output current, so keep that in mind).
I hope this works for you. Be sure to check your sensor to check the specs. If you're not sure, feel free to post again with more information. Battery voltage, relay coil resistance, sensor type would all be helpful.