X can be convicted of murder in all jurisdiction in the United States (and probably the other common law jurisdictions). The issue here is two-fold.
Contracts that involve illegal actions are not enforceable. In fact, the contract killing example you gave is a classic illegal agreement/contract. See the Wikipedia articles on illegal agreements and contract killings.
Most criminal prosecutions involving bodily injury or death proceed regardless of the victim's wishes. This is because the prosecution represents the State's interests and can prosecute a case where the victims want it dismissed. Consider and example where the "battered spouse" doesn't want to testify against his/her abuser. The prosecution can still bring changes where the victim is not cooperative. It just makes proving their case more difficult. Check out this article from the DOJ that discusses how victims do not have a right to veto a plea agreement or other prosecutorial decisions. http://www.lclark.edu/live/files/6439-input-into-plea-agreement
One could make an argument that the affirmative defense of consent could apply; however, most states have consent statutes like Colorado's that would not apply to murder. See C.R.S. § 18-1-505(2), which states:
When conduct is charged is charged to constitute an offense because
it causes or threatens bodily injury, consent to that conduct or to
the infliction of that injury is a defense only if the bodily injury
consented to or threatened by the conduct consented to is not serious,
or the conduct and the injury are reasonably foreseeable hazards of
joint participation in a lawful athletic contest or competitive sport,
or the consent establishes a justification under sections 18-1-701 to
This statutes basically says consent doesn't apply where someone received serious bodily injury (murder would meet this standard), unless they are in a lawful athletic sport, such as boxing.