We incorporate word of mouth (WoM) in a classic Maskin-Riley contracting problem, allowing for referral rewards to senders of WoM. Current customers’ incentives to engage in WoM can affect the contracting problem of a firm in the presence of positive externalities of users. We fully characterize the optimal contract scheme and provide comparative statics. In particular, we show that offering a free contract is optimal only if the fraction of premium users in the population is small. The reason is that by offering a free product, the firm can incentivize senders to talk by increasing expected externalities that they receive and this is effective only if there are many free users. This result is consistent with the observation that companies that successfully offer freemium contracts oftentimes have a high percentage of free users.