Yes, lying around too much can cause back pain.
When the core muscles get weak, especially those in the anterior (front) lower abdomen, the back muscles work harder to compensate. This sets up a chain of events that causes back pain.
There are other issues that can exacerbate back pain -- laying on your back without supporting your knees, lying on your side without keeping the spine straight and supporting the neck.
A skilled chiropractor or physiatrist / physical therapist can give you advice and exercises appropriate to your current condition.
I have that problem to, and what I've noticed for myself, is that while in motion I notice pain less...and so when at rest it feels good until it's time to move again...