The WikiQuote page for Karl Marx claims he wrote this in a letter to Pavel Annenkov, 28 December 1846:

Freedom and slavery constitute an antagonism. There is no need for me to speak either of the good or of the bad aspects of freedom. As for slavery, there is no need for me to speak of its bad aspects. The only thing requiring explanation is the good side of slavery. I do not mean indirect slavery, the slavery of proletariat; I mean direct slavery, the slavery of the Blacks in Surinam, in Brazil, in the southern regions of North America.

Direct slavery is as much the pivot upon which our present-day industrialism turns as are machinery, credit, etc. Without slavery there would be no cotton, without cotton there would be no modern industry. It is slavery which has given value to the European colonies, it is the colonies which have created world trade, and world trade is the necessary condition for large-scale machine industry. Consequently, prior to the slave trade, the colonies sent very few products to the Old World, and did not noticeably change the face of the world. Slavery is therefore an economic category of paramount importance.

Without slavery, North America, the most progressive nation, would be transformed into a patriarchal country. Only wipe North America off the map and you will get anarchy, the complete decay of trade and modern civilisation. But to do away with slavery would be to wipe America off the map. Being an economic category, slavery has existed in all nations since the beginning of the world. All that modern nations have achieved is to disguise slavery at home and import it openly into the New World.