Singlet-triplet transition of a two-electron quantum ring in magnetic and electric fields