Back pain is common from poor posture, especially from long periods of sitting.
Poor sitting posture straighten the back muscles and weakens your abdominal muscles and front hips. Over time this can change your low back spine to straighten also causing a loss of the normal curve.
When this occurs the low back spinal joint motion stops, then (like wearing a brace long-term) will cause the muscles to shrink -called atrophy. This causes you to feel pain and weakness, especially when going from a sitting to a standing position.
After you can stretch your back muscles to a normal position (See this post), then try these exercises to build muscle and reduce pain.