Catalyzes the ATP-dependent amination of UTP to CTP with either L-glutamine or ammonia as the source of nitrogen. ATP + H2O + L-glutamine + UTP = ADP + CTP + 2 H(+) + L-glutamate + phosphate Pyrimidine metabolism; CTP biosynthesis via de novo pathway; CTP from UDP: step 2/2. Belongs to the CTP synthase family.