Obviously the total cost is more than $34k/yr, because graduate students, like any other employees, have overhead. But university money has a way of going around in circles, and (although I haven’t checked the particular details here), a good fraction of this money may be chargeable to grants, this costing the university as a whole nothing except to the extent that these charges displace other charges that the university might otherwise benefit from.
In fact, in some cases, universities charge more than 100%: the university can charge a “fee” (graduate tuition) and bill that fee to a grant. And in other cases (but maybe not under this agreement), the university can collect the fee from the student.
For comparison, NSF GRFP currently pays $37k/yr. Stanford appears to pay about $27k/yr (which, if I understood the table right, is a bit embarrassing). The DoD’s NDSEG pays $40.8k/yr. Hertz pays $34k/yr.
So, as far as I’m concerned, this agreement is a bargain for UC.