Counterfeit is a fake. It's made to look like the real thing.
Pirated is an unauthorized manufacture of the real thing.
Contraband is a thing that is imported (or exported) illegally. This can also include things that are explicitly illegal, such as narcotics or firearms, for instance in a prison, even if they are legal to import or export (as mentioned in comments by @gracey209).
We usually think of luxury goods when we think of counterfeits; inferior quality with deceptive design and brand markings.
We often think of music and movies when we think of pirated goods. However there is an interesting form of piracy whereby a manufacturer who is tooled to build an item during the day for a recognized brand runs the plant at night building the same item but labels it differently and ships it out the back door. That's obviously an example but should show the distinction of pirated goods - same quality but different branding.