What was the role of the catholic church in medieval europe