AlGaN/GaN quantum well (QWs) were grown on (0001) sapphire substrates by molecular beam epitaxy (MBE) using ammonia as nitrogen precursor. The Al composition in the barriers was varied between 8 and 27 % and the well thickness from 4 to 17 monolayers (MLs, 1ML = 2.59 Angstrom). X-ray diffraction (XRD) experiments are used to investigate the strain state of both the well and the barriers. The QW transition energy are measured by low temperature photoluminescence (PL). A large quantum confined Stark effect is observed leading to QW luminescence much lower than the emission line of the GaN buffer layer for well width above a certain critical thickness. The built-in electric field responsible for such a phenomenon is deduced from fit of the PL data. Its magnitude is of several hundred kV/cm and increases linearly with the Al composition.