Square will pay $297 million in stock and cash for the stake in Tidal. Jay-Z will join Square’s board.