Regularity of convex functions on Heisenberg groups