O you who have believed, fulfill [all] contracts
O you who have believed, fulfill [all] contracts. Lawful for you are the animals of grazing livestock except for that which is recited to you [in this Qur'an] - hunting not being permitted while you are in the state of ihraam. Indeed, Allah ordains what He intends.
[Qur'aan 5:1]
Al-Zujaaj said: The meaning is that fulfill the contract which Allah has made obligatory on you and the contracts you make among yourselves.
Allah has a contract with mankind. The contract is that we are to believe in Him and His Messengers and obey Him. We are to stay away from those things which He has made impermissible.
We are to fulfill those duties which He has made obligatory for us.
It is incumbent upon us to fulfill this covenant with Allah to the best of our ability.
In addition to this, when we make worldly contracts with others, it is obligatory for us to fulfill those contracts as well.
But if a contract has conditions in it which go against the Laws of Allah, then those conditions are not to be fulfilled. Only those contracts and conditions which are in accordance with the Book of Allah are to be fulfilled. There is no obedience to the creation when it entails disobedience to the Creator.
Reference(s):