Refinements of the Hermite-Hadamard inequality for convex functions