Writing can also be a pain in the shoulders, the back, the knees, and the wrists. We need to be very careful not to sit too long without getting up and stretching.
It's hard to make myself get out of my writing chair and exercise when I'm on the home stretch of a novel's first draft. Time evaporates. I'm stiff and sore before I realize what's happening. Since I have a bit of arthritis and also experience occasional fibromyalgia flares, movement is absolutely necessary. A regular stretching program helps. Working out and weight training is useful. Yoga is also excellent.
One of the most helpful things I've learned how to do is a series of positions and stretches created by Pete Egoscue. Some of the program is similar to Yoga, but most of it is easier than Yoga. I'd recommend going to a clinic if you have one nearby, but the sessions are pricey and probably not covered by most writers' insurance. However, there's an easier and cheaper way to find out what the Egoscue Method is like.
Much of the theory and an illustrated guide to the program can be found in Egoscue's excellent book, Pain Free: A Revolutionary Method for Stopping Chronic Pain. Your library may have a copy or might be willing to order it. I'm a firm believer in the method and always feel better when I'm following the program daily.