Magnetic reconnection with radiative cooling. I. Optically thin regime