All those exercises from @mvmac are very good and will help. But if the pain/stiffness is from using a computer all day then you really need to make sure your workstation is as ergonomic as possible and properly adjusted to you.
I had the problem that i was working 12hours a day on my laptop which was killing my neck big time. Two months ago i invested in a laptop stand to move the top of the screen to the right height and bought a USB keyboard and mouse to use. Neck pain no longer keeps me awake at night so adjusting my working environment as certainly helped me.
Now, for you this might not be the case but certainly check out the link and check you are working comfortably and looking after your back and neck: http://www.wikihow.com/Sit-at-a-Computer