In my opinion, pain is sign of immune reaction against viral infection. Typical symptoms such as coughing and sneezing, fever, inflammation, vomiting, diarrhea, fatigue, and cramping -- all of which are ways the immune system tries to rid the body of infectious organisms [1]. Hence, virus is not directly modulate pain, the body signals you to feel pain and recognize the sickness.
Pain in case of a virus infection is a secondary effect of the inflammation ... no inflammation = no pain.
IN the answer above inflammation is the operative effect of the immune system trying to get rid of the virus; sneezing, vomiting, diarrhea, fatigue and cramping are all secondary to (the result of) the inflammation and while (partially) effective in getting rid of a bacterial infection do little or nothing for a viral infection (remember the virus is INSIDE you own cells).
update: something I had not considered when writing the above, in the case of a cytolytic virus pain might be the result of organ destruction and the resulting disfunction.
I think your question needs a little clarification. Viral infection is something that we can characterize precisely like we can know the quantity of viral particles, the interaction with other viruses...however the pain modulation is something really hard to characterize if not impossible. Seeing the previous answers, I think that the inflammation axe can be considered as promising but for me it is not sufficient alone.