Discovery Inc.-backed digital publisher Group Nine Media has agreed to acquire women-focused publisher PopSugar, the companies said, the latest merger among new-media firms hoping that greater scale will help them sell online ads, where Facebook Inc. and Alphabet Inc.’s Google dominate.