Vampirism
"Porphoric Hemophilia" as it is referred to by scientists in the game, can be contracted in two ways: being attacked by a hostile vampire, or by requesting a friendly one share "The Dark Gift" with you. There are numerous large skill bonuses for remaining a vampire, provided you are willing to feed regularly and stay out of the sun. If you don't feed regularly enough, your visible appearance will change and the non-player characters will shun you, preventing you from accessing any quests.
Prevention
Vampirism is classed in the game as a disease, and can be resisted just as any other one. Take a Resist Disease potion or use an equivalent spell if you spot any vampires on your travels. If you are bitten by a vampire during a quest, a dialogue will appear in the upper left corner, stating, "You have contracted Porphoric Hemophilia." This is only the first stage of the disease, and you have 24 in-game hours to administer a cure, before any permanent effects occur.
Treatment
The initial stages of the disease can be cured with any standard Cure Disease potion or spell administered within the first 24 hours of infection. If you do not have either, proceed to the nearest town or trader to try to obtain one. Avoid using the fast-travel function as this advances time by an unknown quantity and could push you outside the treatment window. If you are short of money, it is better to sell any items you are carrying to the trader. They can be bought back later, but full vampirism is more time consuming to reverse.
Cure Quest
The quest to cure full-blown vampirism is a long one. Speak to Raminus Polus in the lobby of the Arcane University. He will direct you to Count Hassildor in Skingrad, who will send you Melisande the witch. Melisande will demand you bring her five Grand Soul Gems in exchange for a recipe that will cure your condition. Three of the gems can be found in the caves at Nornal, Squandered Mine, and Crayfish Cave. They are generated only when you speak to Melisande. The remaining two can be purchased from Mage's Guild Associates and merchants, provided your character is level 12 or above.