The parent company of Saks Fifth Avenue has signed a deal to buy upscale rival Neiman Marcus Group, which owns Neiman Marcus and Bergdorf Goodman stores, for more than $2.5 billion, Amazon holding a minority stake.