The HPV vaccine is only effective for preventing the infection, and does not cure infections that have already occurred. Because there are many strains of HPV that can cause cervical cancer or warts, it is still a good idea to get vaccinated even after you have been infected by certain strains because it can still protect you from future infections from the other strains.
In addition, the vaccine does not cover all the strains that can cause disease. It is, therefore, important to continue regular gynecological check ups even after you have been vaccinated, especially if you have been infected already.