Optical dressing of the electronic response of two-dimensional semiconductors in quantum and classical descriptions of cavity electrodynamics