Despite a 5 percent drop in digital advertising, the company’s chief executive, Mark Thompson, called it the “best advertising quarter of the year.”