If you just want to have the contract's text/data linked to the asset, your best bet is probably to publish it as a stream item in the same transaction as that which creates the asset, so they are always linked.
This can be achieved using the createrawsendfrom API to create a single transaction which both issues the asset and publishes to a stream. See the page below and/or the help within MultiChain:
https://www.multichain.com/developers/raw-transactions/
If you want the contract's specification to actually be enforced by MultiChain as a rule for asset transfers, you would have to write some kind of translation layer which applies it as part of a transaction filter:
https://www.multichain.com/developers/smart-filters/