An electrically controllable spin qubit in a semiconductor nanowire