Phase transitions in SrTiO3 quantum paraelectric with impurities