Yes we are allowed to keep them as pets, there is no evidence in the Shari'ah which prohibits having cats as pets. But we have to be carefull that we do not pray with the cat hairs on our body or cloths of prayer.
With regards to the cat's hair, see the mas'ala on "dress for prayer" in the risalahs of the maraji`. Ayatullah Khu`i, for example, says: The dress for prayer should "not be from the parts of the animal whose meat is not halal...this would also apply to the hair found on the cloths, etc." (Minhaju 's-Salihiyn, vol. 1, p. 138) Cat is surely an animal whose meat is not halal, and, therefore, its hair should not be on the dress of one who wants to do salat.