Manipulating the magnetic state of a carbon nanotube Josephson junction using the superconducting phase