Allah (G. B. H) says: {But do not associate with your wives while you are in seclusion in the mosques} [Al-Baqara: 187] , and Aisha (G. p. H) said: "The Messenger of Allah (P. B. U. H) used to go into i'tikaf in the last ten days of Ramadan,"
[Muslim, Vol. 2, The Book of Fasting, Chapter 1/3] as well as the consensus of the Muslim nation.