I've never heard of an iPhone getting a virus, however, restoring as new should do the trick. Remember, if there is a virus, it may be in your back-up, so check everything out and put back your info one item at a time. Good luck.
There is no virus. The only way you would get a virus on an iPhone, is if you are jailbroken and have downloaded cracked apps or some other bad tweaks or apps. Are you jailbroken?