Sayyiduna al-Harith al-Ash'ari (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: "Allah Almighty sent revelation to Yahya bin Zakariyya (peace be upon him), so he stood up, praised Allah and extolled Him. Then he said: Allah has commanded you to pray, and when a person stands for prayer, Allah Almighty turns towards him, so let no one turn his face away from Him. When the servant turns his face away, Allah Almighty also withdraws His attention from him."
Abu Tawbah narrated this from Mu'awiyah, and in it is: "When you set your faces (towards the qiblah), do not look around."
Yahya bin Abi Kathir narrated the same through Zayd bin Sallam: "When you stand for prayer, do not look around."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3533