It's due to muscle spasm, and inflammation, start with analgesics, rest for few days and contrast bath for 2 to 3 days.
Next Steps
if it's not improving start physiotherapy asap along with proper posture maintenance and cervical isometric exercises and use cervical pillow to maintain proper posture.
Health Tips
Avoid using computer constantly for long hours