Bayesian inversion with a hierarchical tensor representation