It is considered a pronoun in your sentence. Using it the way it is used here has been common and grammatical in English for ages and similar usage occurs in some other Germanic languages. It is true that there are languages, like my native language Finnish, in which the equivalent of it cannot be used in such a vague way.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.