The aim of this paper is to determine the optimal structure of derivatives written on an illiquid asset, such as a catastrophic or a weather event. This transaction involves two agents: a bank which wants to hedge its initial exposure towards this illiquid asset and an investor which may buy the contract. Both agents also have the opportunity to invest their residual wealth on a financial market. Based on a utility maximization point of view, we determine an optimal profile (and its value) such that it maximizes the bank's utility given that the investor decides to make the deal only if it increases its utility. In the case of exponential utility, we show that the pricing rule is a non-linear function of the structure and that the bank always transfers the same proportion of its initial exposure. In the general case, an additional term appears, depending only on the relative log-likelihood of the two agents' views of the distribution of the illiquid asset.