Something illegal is forbidden by law: It is illegal for motocyclists not to wear a crash helmet.
If a thing is illicit it is done by someone who knows that it is disallowed by law but that under different circumstances it could be legal: The crew were involved in the illicit import of brandy (it is basically legal to import brandy but not the way they did it).
If a thing is illicit it is done by someone who knows that it is disallowed by law but that under different circumstances it could be legal: The crew were involved in the illicit import of brandy (it is basically legal to import brandy but not the way they did it).