Prostatitis is an inflammation of the prostate. Depending on the severity, it might be acute prostatitis, chronic prostatitis, and chronic pelvic pain syndrome. Aside from the last mentioned, the first two are caused by bacteria. If untreated, acute prostatitis might turn into chronic prostatitis. Both the acute and the chronic form are closely related to urinary tract infections.
Actually, in most cases, the prostate inflammation is caused by a urinary tract infection which has affected the prostate tissue as well. The prostatitis itself is not known as a cause for infertility, but if the infection is left untreated it might spread to other reproductive organs including the testicles (orchitis) and the epididymis (epididymitis). If untreated, these conditions might cause infertility. However, this is rare because the signs of advanced infection are easily detected and the treatment, which usually uses antibiotics, is usually given in time.
However, if you want to be sure about your fertility, you might want to visit a urologist after the treatment is completed and ask for a spermogram which counts the number of spermatozoids in the semen as well as their viability and potential for fertilization.