Optical properties and superconductivity of NbSe2