Order of author names in a textbook that is to be published
First of all, I agree with @tonysdg that A and B don't sound like they deserve any form of authorship. The same may be true about U, V and W, but I feel less strongly about that. So Z can simply argue his/her case forcefully, and if necessary appeal to the department chair or other outside objective parties. The facts are on Z's side, so I expect he/she will win the argument, though possibly at the risk of alienating his/her colleagues. 

Second of all, with regards to your comment that "The problem is, Z's last name is the last in alphabetical order and making A and B authors will push Z's name to the back of the author list", I don't see this as a problem at all. There is no rule that the list of author names on a book has to be in alphabetical order. So, it is perfectly acceptable and legitimate to list Z's name first, and indeed sounds like a very good idea (regardless of which other names end up being on the author list) considering that the project is overwhelmingly Z's intellectual offspring.

Third of all, one idea for an author byline that allows including minor authors but would still make clear the large disparity in contributions from the different authors is to use the "with contributions from" pattern, as in:


  The Great Book of Science
  
  By Z
  With contributions from U, V, W, [optionally:] A and B


See here for a real-life example.