The vaccine prevents infection by other types of HPV and prevents reinfection by the same type, but does not clear the infection. Therefore, if you have been diagnosed with HPV it could still be beneficial for you to get vaccinated, even though it will not help you clear that particular infection.
However, the HPV vaccine is currently only provided free of charge by the NHS for girls aged 11–17 in Scotland and 12–17 in the rest of the UK (up until their 18th birthday), and only girls aged 11–13 in Scotland and 12–13 in the rest of the UK will be routinely offered the vaccine.
If you are ineligible for the NHS vaccination programme you can pay to have the vaccine privately. The complete course of the vaccine requires three doses with each dose costing around £150.