Thanks for writing to HCM
Your problem may be due to spasm of muscles due to sudden streching or unaccustomed body posture.
You can take muscle relaxants like tizanidine
tablets 4mg twice daily for 3-4 days along with pain killers like acelofenac tablets twice daily for short duration of 3-4 days.
Hot compression will also help you.
If symptoms persist then X-rays of cervical spine
AP/Lateral view should be taken to rule out cervical spondylosis
Get well soon.