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 other 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 can (partly) substitute for paying referral rewards only if there are few premium customers. This result is consistent with the observation that companies that successfully offer freemium contracts oftentimes have a high percentage of free users.