It can be a vicious cycle.
Aside from a good therapeutic massage, finding a proper sleep position can also help reduce back pain. So if you are a side sleeper, try placing a pillow between your knees to keep your spine in a neutral position and relieve strain on your back. If you need to sleep on your back, sliding a pillow under your knees should help, too. And always be sure to sleep on a comfortably firm mattress.
If pain persists and is still making it hard to sleep after a few days, be sure to talk to your doctor.
Oh, and getting into good bedtime habits -- including keeping a regular bedtime and wake time schedule -- can help too.