Quantum phase transitions and persistent currents in Josephson-junction ladders