Giving extra notice is a courtesy that you are welcome to extend at your discretion.
No employer is ever upset that an employee or contractor wanted to stay on for longer or give additional lead time to find a replacement. This is definitely considered a "polite" thing to do, and it reflects well on you as a professional.
Ways to go about it
Judging from the tone & content of your question, it sounds like this is an employer you like and/or have a good working relationship with. Since it seems you have no problem with finishing your current contract and possibly an extra window at the end, your main consideration would be how to go about giving this notice and structuring the transition period.
Option 1: Be up front
Rather than give notice at the point the contract ends, be proactive with the employer. Let your manager or point of contact know that as much as you've enjoyed working with them, you'd like to move on to other opporutinites and will not be renewing your contract once it runs up. This will give them extra lead time to try and find a replacement. It may also, depending on how your work is structured/managed, may help you plan transition tasks into your workload—things like more robust documentation, or closing out certain parts of the work that are more involved or dependent on your institutional knowledge.
In my opinion, this is likely your best option. You are being forthright about your plans, and triggering early the discussion about the end of your contact, which is a more productive time to discuss this than a week before your contract ends. Having increased time and visibility into their future resourcing needs is beneficial to smoothly running their business, and employers tend to appreciate things that align with their business goals.
It sounds like you have a good relationship with your employer, so this shouldn't cause problems. If this is not the case, or if the employer lacks maturity or professionalism, this could potentially cause you headaches by souring what would have been a smooth relationship for the duration your contract.
I would recommend assessing your employer and relationship with them and act accordingly.
Option 2: Plan a flexible contract for the transition
Let them know that you're not interested in renewing the contract for a significant length of time, but that you are willing to stay on until they find a replacement. Set up a new contract without a fixed duration so that they're not left in the lurch while they find someone new.
Be careful with this one—this may destroy any sense of urgency they may have to find a replacement since they already "have" someone to do the work. If you choose this option, I'd set an upper limit of how long you're willing to stay if they don't find anyone.
Option 3: Give your 2 weeks and move on
As much as it would be polite and considerate to give extra notice, you're under no obligation to do so, and your employer probably has no expectation that you will do so. If giving extra notice is "polite", giving just 2 weeks is not "impolite" by any means. No one will fault you for it, and you can always be a little more generous if you choose—3 weeks and then leaving is already above and beyond.