UC involves inflammation of the large intestine that's most likely caused by our immune system. Joint pains are inflammation of the joints (also known as an arthritis but can occur at any age) and are most likely caused by our immune system. It's possible you have an extra-intestinal-manifestation of UC.
Here's a good read from the CCFA on it, give it a read if you haven't already:www.crohnscolitisfoundation.org/assets/pdfs/arthritiscomplications.pdf
Sometimes we can take sulfasalazine instead of mesalamine as it will treat both joint pains and UC at once.
Sometimes we can take a COX-2 style NSAID which are safer than standard NSAIDs for us.
Sometimes we just take a NSAID sparingly, even though they have the risk of worsening our UC.
It really depends on how bad the joint pain is, and I'm guessing it is pretty bad for you to ask about
it. I would see a doctor about
it. Just take the above and suggestions other's here have with you, so you know some possibilities of what it could be. Get some diagnostic tests to see if you can narrow down what it actually is. And don't rule out RA and other auto-immune conditions, as sometimes we develop a 2nd or 3rd after time...
It truly sucks though, having joint pains and UC. Like UC isn't enough as it is!