Scalar and pseudoscalar Higgs production in association with a top–antitop pair