I tried to add a new contact from an sms message in my iphone, it was not obvious at first jow to do it.

what you have to do is:

scroll to the very first message from that contact.
you will see an ‘add to contacts’ button.
you can then add the number to a new or existing contact!