If they just sold you the CD then it was illegal. For the rules click here
But even if you bought before these came in it wouldn't have made any difference. Unless you were buying a new machine, or a qualifying piece of hardware (which must be installed and in use) OEM has always been a no go. But that didn't stop anyone selling them.
You must, I'm afraid, buy a retail copy. An Upgrade cd would do for around £80