Thanks for posting your querry.
After reading your symptoms, i feel that you have developed back muscle spasm. This can occur when the muscle gets stretched in a painful way due to faulty posture(in your case while sleeping).
Ideally you need to visit a physiotherapist for a couple of sessions and also take any good muscle relaxant
drug along with application of topical local analgesic
spray/ointment for relief. Even hot foamentation will help in reducing/eliminating the pain.
Hope you feel better soon.