Genesis 9:25 And he said, Cursed be Canaan; a servant of servants shall he be unto his brethren. (KJV)
Leviticus 25:46 And ye shall take them as an inheritance for your children after you, to inherit them for a possession; they shall be your bondmen for ever: but over your brethren the children of Israel, ye shall not rule one over another with rigour. (KJV)
Joel 3:8 And I will sell your sons and your daughters into the hand of the children of Judah, and they shall sell them to the Sabeans, to a people far off: for the LORD hath spoken it. (KJV)
Exodus 21:16 And he that stealeth a man, and selleth him, or if he be found in his hand, he shall surely be put to death. (KJV)
Slavery as we know it, that is the stealing and then buying or selling of men, is clearly forbidden by Exodus 21:16. The Genesis 9 passage is being uttered, not by God, but by Noah, and this is a prophecy, not an endorsement. The Leviticus passage refers to servants (though they were bought and sold and not paid in anything other than room and board, they were in their situations voluntarily). The Joel passage refers to prisoners of war, not to people who were stolen. Not a contradiction.