The Josephson junction as a quantum engine