RIM to pay Nokia royalties for patents