Yes, exercise is important in order to maintain healthy muscles! If we allow our muscles to waste away this has a detrimental effect on our bodies and can exacerbate our pain!
Low impact exercising is best, so swimming would be ideal. Walking and cycling can also be beneficial, but you should never push yourself too hard. You should only exercise within your own limits and capabilities.