Measurement of the decay amplitudes and branching fractions of B→J/ψK* and B→J/ψK Decays