You say that only the first 10cm of your bowel is involved. Therefore, it is highly unlikely to have been developed from anal intercourse.
It most probably seems like ulcerative colitis
Do practice safe sex
while having sexual intercourse, be it in any form.
Further work up of Ulcerative colitis is required and treatment initiated accordingly.
Hope this helps.