As the IT industry is becoming more and more interested in service oriented business models and upcoming technologies like Web Services or Grid Computing, the need for automated contract management increases accordingly. In this paper we evolve a formal representation for contractual agreements together with their monitoring and enforcement by standard components of logic programming. We incorporate different logical formalisms like Horn Logic, Event Calculus, Deontic Logic and ECA rules into one logical framework to execute complex contract rules on an individual or a group level together with their normative relationships (permissions, obligations and prohibitions). This logical framework supports a high level architecture for the automation of electronic contracts capable of representing complex business rules and business policies, detecting contract violations, authorisation control, conflict detection, service billing, reporting and other contract enforcement processes.