Merger rates in hierarchical models of galaxy formation – II. Comparison with N-body simulations