I happened to be reading The Selfish Gene by Richard Dawkins and Gödel, Escher, Bach by Douglas Hofstadter at the same time, and both of them point at exactly this being the reason for consciousness. I was stunning at how both reached the same conclusion, that consciousness arrises from recursion of self perception, from very different points.
Also, if anyone is watching Westworld (spoilers), it seems to come to the same conclusion funnily enough. What finally gives the androids consciousness is some kind of recursive idea of listening to themselves.