Optical and electrochemical studies of the underpotential deposition of metals