The 18-year-old came through the club's academy and made 38 appearances in all competitions this season.
He has been called up to the England Under-20 squad for the first time and could make his debut later this month in the Toulon Tournament.
Vieira is the first player to sign a new contract with the club since they were taken over by Italian businessman Andrea Radrizzani on Tuesday.
Leeds midfielder Ronaldo Vieira has signed a four-year contract extension.