Electric-field-controlled spin reversal in a quantum dot with ferromagnetic contacts