Contraband is any cargo that is illegal according to Confed law. This includes weaponry, any of the three types of drugs (tobacco, Brilliance and Ultimate), radioactives (uranium and plutonium) and slaves. They are marked red in the Exchange screen and can't be traded on many planets and bases (price shown as 'N/A').

Confed ships sometimes scan you for contraband. On Pirate bases you can buy Hidden Compartments that prevent detection of up to 10% of your total cargo space for 2000 credits per cargo unit.

Interestingly, the drug items Refined Ultimate and Brilliance Ampules don't count as contraband, probably because they are equipment, not cargo i.e. can be sold at an Equipment Store, not at the Exchange.