BERLIN (Reuters) - German and U.S. employers, workers, consumers and farmers would "without doubt" benefit from a free trade deal being negotiated between the European Union and the United States, U.S. President Barack Obama and German Chancellor Angela Merkel said.

Their comments were in sharp contrast to those of U.S. President-elect Donald Trump who made attacks on international trade deals a cornerstone of his election campaign, saying they have cost U.S. jobs.

"An agreement that links our economies more closely and that builds on rules that comply with our shared values would help us to grow over the coming decades and to remain competitive at the global level," Obama and Merkel wrote in a joint article for German magazine WirtschaftsWoche.

Defying Trump's protectionist rhetoric, Merkel and Obama said the United States and Germany were stronger if they worked together and stressed that cooperation is now more important than ever before because the global economy is developing more rapidly than ever before while global challenges are developing at the same speed.

"There will be no return to a world before globalization," they wrote, according to an advance extract of their article that is due to be published on Friday.

The two leaders added that Germans and Americans needed to take the opportunity to shape the way globalization happens according to their own values and ideas.

"We owe it to our companies and our citizens - and in fact to the whole international community - to broaden and deepen our cooperation," Obama and Merkel said.

Given that decisions in one country are felt in other countries, it is crucial to have rules like those being negotiated in the EU-U.S. trade deal called the Transatlantic Trade and Investment Partnership (TTIP), Obama and Merkel said.

Merkel was the driving force in Europe behind TTIP, which has been under negotiation for more than three years. Brussels and Washington both realize it will not now be completed under Obama's term as earlier envisaged.

"We're campaigning for international laws and norms around the world to be respected - as a prerequisite for stability and prosperity," Obama and Merkel wrote.

(Reporting by Michelle Martin and Michael Nienaber; Writing by Michelle Martin; Editing by Paul Carrel and Richard Balmforth)