We present a method for studying the proximity effect and the density structure around redshift z=2-3 quasars . It is based on the probability distribution of Lyman- \alpha pixel optical depths and its evolution with redshift . We validate the method using mock spectra obtained from hydrodynamical simulations , and then apply it to a sample of 12 bright quasars at redshifts 2-3 observed with UVES at the VLT-UT2 Kueyen ESO telescope . These quasars do not show signatures of associated absorption and have a mean monochromatic luminosity of 5.4 \times 10 ^ { 31 } h ^ { -2 } erg s ^ { -1 } Hz ^ { -1 } at the Lyman limit . The observed distribution of optical depth within 10 h ^ { -1 } Mpc from the QSO is statistically different from that measured in the general intergalactic medium at the same redshift . Such a change will result from the combined effects of the increase in photoionisation rate above the mean UV-background due to the extra ionizing photons from the quasar radiation ( proximity effect ) , and the higher density of the IGM if the quasars reside in overdense regions ( as expected from biased galaxy formation ) . The first factor decreases the optical depth whereas the second one increases the optical depth , but our measurement can not distinguish a high background from a low overdensity . An overdensity of the order of a few is required if we use the amplitude of the UV-background inferred from the mean Lyman- \alpha opacity . If no overdensity is present , then we require the UV-background to be higher , and consistent with the existing measurements based on standard analysis of the proximity effect .