Short Answer
Opposite in logic is generally taken to mean logical negation. A contradiction in logic is generally taken to be two propositions whose truth values are opposites.
Example: P and ~P are opposites, but the set {P, ~P} is a contradiction.
Long Answer
If you're familiar with formal set theory, you know there are different between naive or intuitional definitions and formal definitions. Intuitively, we can talk about 'collections', but in ZFC, 'set' has a rigorous definition. 'Opposite' is a lot like that in logic. It's a matter of fact that 'opposite' doesn't appear in Oxford's dictionary of logic as an entry, although it is used in the dictionary. So, opposite is an intuitional sense. In fact, in mathematical logic, which might be seen as a theory that combines mathematical and logical thinking, opposite has more than one meaning, for instance, when talking about opposites of positive integers (negative integers), opposites of operations (inverses), and of course, opposite meanings (P and ~P). To understand the difference fully, it is helpful to appeal to two "laws" of logic, the principle of bivalence (PB) and the law of noncontradiction (LNC).
PB states:
In logic, the semantic principle (or law) of bivalence states that every declarative sentence expressing a proposition (of a theory under inspection) has exactly one truth value, either true or false. 1 A logic satisfying this principle is called a two-valued logic3 or bivalent logic.2
LNC states:
In logic, the law of non-contradiction (LNC) (also known as the law of contradiction, principle of non-contradiction (PNC), or the principle of contradiction) states that contradictory propositions cannot both be true in the same sense at the same time, e. g. the two propositions "p is the case" and "p is not the case" are mutually exclusive. Formally this is expressed as the tautology ¬(p ∧ ¬p). The law is not to be confused with the law of excluded middle which states that at least one, "p is the case" or "p is not the case" holds.
So, PB is saying that for any formula F, it can be assigned one of two truth values, either T or F where T is defined as ~F. LNC says that in a logical system, F can either be T or F but not both. It should be noted that PB implies a logic is binary, that is, has two truth values, and that LNC doesn't tolerate contradictions for proof, unless the contradiction is used to draw a conclusion proof by contradiction is a proof technique.
PB and LNC are relevant to the laws of thought, which is the observation that human discourse seems to obey certain principles be they what they may. Also note, that LNC is not universal to systems of logic. More recent developments in logic, called non-classical logics (See Bumble's answer to In how many and which ways can a logic be non-classical? Are there systems for organizing them? (PhilSE)) might reject a "law" such as LNC.