The strength of the rainbow Ramsey theorem