Sayyiduna Abu Dharr (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "As long as the servant does not look around in prayer, Allah Almighty remains turned towards him, and when he turns his face away, Allah Almighty also turns His attention away from him."
A narration with the same meaning is also reported from Sayyiduna al-Harith al-Ash'ari (may Allah be pleased with him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3532