As Patricia said:
To fill in the space, use HAVE - "I would rather have a quiet cup of coffee in the office than sit in a noisy cafe."
Or alternatively - "I prefer a quiet cup of coffee in the office than to sit in a noisy cafe."
Many will state that you can say: "I prefer to have a quiet cup of coffee in the office than sit in a noisy cafe.", but the meaning is slightly different. Here, you're preferring a "quiet cup of coffee" to a "noisy cafe", with "in the office" acting as a qualifier for the coffee. Although most people will understand your meaning, it won't be accurate.
If you want the "prefer to" form, then a statement with a similar meaning would actually be - "I prefer to have coffee in the office than to sit in a noisy cafe." - here, you're comparing (preferring) apples to apples - an office environment versus a cafe; with the "noisy" cafe implicitly stating a "quiet" office.