The law that governs the contract is the law that determines matters like how the contract should be interpreted, and whether the parties have performed or breached their obligations.
The Rome I EU regulation governs the law to be applied to contractual obligations where that question is being decided by a court in the EU. It applies whether or not the parties are based in the UK and whether or not the governing law is that of an EU member state. These rules will therefore apply if the courts in the EU are asked to determine the law that governs a contract. However, courts outside the EU may use different rules if asked to decide this question.
It's always best to specify which country's law governs the contract in a choice of law clause. An English party would usually want English law to apply, as well as wanting the English courts to have jurisdiction to decide on any disputes. However, it's possible (but not convenient) to have the English courts decide on disputes by applying the law of another country. In this case, an expert on the foreign law would have to give evidence in the English court of what that foreign law is. This would be more expensive than having an English judge apply English law.
If the parties don't specify which law should apply to a contract, there are default rules in the Rome convention that would determine this, but these rules leave room for uncertainty.
If the parties to a contract choose the law of the country where one of them has their home, the courts will generally apply the law chosen. However, if they choose the law of a county that isn't connected to the contract in any other way, some of the laws of the country the contract is connected to ('mandatory rules') may also apply.
Special rules apply to consumer contracts where the seller or provider carries out business in or directs their activities to the consumer's country. If the law chosen in the contract isn't that of the country where the consumer has their home, the mandatory rules of the consumer's country will apply as well.
These mandatory rules are designed to protect the consumer. Examples in England are:
If the terms of the contract conflict with the mandatory rules of the consumer's country, the mandatory rules will override the contract terms.
Another example of mandatory rules are the Commercial Agents' Regulations 1993. These regulations protect the agents in an agency contract. These will apply to protect an agent based in England even if the contract says that the law governing the agency contract is the law of a different country.
The general rule applied by courts in the EU is that if the parties haven't chosen the law of the contract, it'll be the law of the country of the party giving the performance that characterises the contract. In sale-of-goods contracts, this is the seller's country, unless it can be shown that the contract has a closer connection with another country.
If the seller is based in a different country from the consumer, the contract will be governed, in general, by the seller's law. However, if the mandatory rules of the consumer's home country are different from the seller's law, these will override the seller's law. The mandatory rules of the country hearing the dispute or the country most closely connected with the contract can also override the seller's law.
As with choice of jurisdiction clauses, it's always best for the parties to a commercial contract to put in an express term relating to the choice of law. However, a seller won't be able to avoid the mandatory rules of the consumer's home country intended to protect the consumer.