The club has also exercised the option of extending the contracts of defenders Paul Dummett and Fabian Schär into the 2021/22 season.
Murphy, Fernández, Gayle and Dummett have all reported back for pre-season training this week, while Schär will return to Tyneside later this month after helping Switzerland to the quarter-final stage of this summer's European Championships.
Newcastle United head coach Steve Bruce said: "I'm delighted to extend the players' contracts.
"They all have a thorough understanding of this club and what it takes to play here, and they have all made excellent contributions over recent years.
"The hard work preparing for the new season has already begun and we’re looking forward to building momentum as we head towards the big kick-off next month."