With a four-year contract, the former host of “The Daily Show” will do digital shorts and may also pursue movie or television projects.