Terance Mann agrees to $47 million contract extension