On certain zeta functions attached to two Hilbert modular forms: II. The case of automorphic forms on a quaternion algebra