The performance of a semiconductor quantum-electronic device ultimately depends on the quality of the semiconductor materials it is made of and on how well the device is isolated from electrostatic fluctuations caused by unavoidable surface charges and other sources of electric noise. Current technology to fabricate quantum semiconductor devices relies on surface gates which impose strong limitations on the maximum distance from the surface where the confining electrostatic potentials can be engineered. Surface gates also introduce strain fields which cause imperfections in the semiconductor crystal structure. Another way to create confining electrostatic potentials inside semiconductors is by means of light and photosensitive dopants. Light can be structured in the form of perfectly parallel sheets of high and low intensity which can penetrate deep into a semiconductor and, importantly, light does not deteriorate the quality of the semiconductor crystal. In this work, we employ these important properties of structured light to form metastable states of photo-sensitive impurities inside a GaAs/AlGaAs quantum well structure in order to create persistent periodic electrostatic potentials at large predetermined distances from the sample surface. The amplitude of the light-induced potential is controlled by gradually increasing the light fluence at the sample surface and simultaneously measuring the amplitude of Weiss commensurability oscillations in the magnetoresistivity.