Optical properties of the quasi-two-dimensional dichalcogenides 2H-TaSe and 2H-NbSe