Of course it is unethical. Regardless of anything your contract might state and regardless of your other options, if your employer needs you, you are bound by duty to stay. You have an ethical obligation to make things as easy as possible for your colleagues, no matter what hardships or long-term commitments this requires that you take on. Having collaborated on a project with others gives the collaboraters an unlimited moral claim on your future time and energy.