Barnes & Noble will develop a tablet with Samsung as it tries to revive its Nook digital business, which has struggled.