How can one compute the mean and the variance of the posterior distribution via NUTS?

You can use the summary utility as in the bayesian regression tutorial.

summary