Please consider the analysis of this sentence: Where is the verb? "écrivent", from verb "écrire", conjugated at the 3rd person plural, present tense. Who is writing? "elles", feminine plural pronoun and subject of the verb What is written? "un livre", direct object of the verb To whom the book is written to? "nous", indirect object of the verb.
In this case, the indirect object is placed before the verb. In English, you could have an alternative construction to mean the same thing: "they write a book to us" but in French "elles écrivent un livre à nous" would not be correct.