Bayesian parameter estimation using conditional variational autoencoders for gravitational-wave astronomy