Measurement of the semileptonic decays B¯→Dτ-ν¯τ and B¯→D*τ-ν¯τ