if he provides me with copyrighted material that I add to the website, would I be liable?
No. Instead, your friend would be liable both directly and vicariously. Direct liability would arise from the fact that your friend himself sends to you the contents he wants in the website. Vicarious liability stems from you making the website on behalf of your friend, with you doing so pursuant to his directions or specs (in other words, to the extent that he is in control of the work you do for him).
Although you did not specify your jurisdiction, Metro-Goldwyn-Mayer Studios Inc. v. Grokster, Ltd., 545 US 913, 930 (2005) or a similar holding from other jurisdictions seems applicable in the situation you describe:
One infringes contributorily by intentionally inducing or encouraging direct infringement [...], and infringes vicariously by profiting from direct infringement while declining to exercise a right to stop or limit it [...].
Requiring from your friend a clear and conspicuous attestation [that his material does not infringe copyright] as a condition for making the website for him disproves an allegation that you contributorily infringed copyright. That is because your requirement is precisely the contrary of [you] inducing or encouraging infringement.
Likewise, the fact that you would make the website for free precludes allegations in the sense of you profiting from the website.
What kind of contract could I have him agree to, for example is this where indemnification comes in?
For evidentiary purposes, the attestation and/or agreement should be in writing, and reflect one way or another your friend's awareness of the terms as well as his intent to comply therewith. Typically the parties' signature proves the contract law elements of awareness and recognition as legally binding.
The agreement should reflect that:
(1) your friend represents that the contents he furnishes to you do not infringe copyright;
(2) you hold no interests (commercial or otherwise) in the product you will implement for free, and you do this only for the benefit of your friend; and
(3) in the event that any claims of copyright arise, your friend will fully respond to the claim(s) and the ensuing judicial or quasi-judicial proceedings, release you of any liability, and hold you harmless.
Since no money is being exchanged, most of the standard templates wouldn't work.
One should never seek to adapt his particular situation or needs to a generic or standard template.
At most, templates should only be glanced at to assess whether one should incorporate some useful or important item in the agreement or contract the parties intend to enter.
The fact that no compensation, consideration, or promise thereof is exchanged makes no difference in this regard.
Would a simple text message saying something like "only give me pictures/photos/music that you yourself made, ok?" and getting "ok" for a reply be enough?
That would suffice only if you are able to prove that it was your friend, not someone else, who confirmed his authorship of the contents submitted.
In most cases it is preferable to sign an agreement that clearly addresses the issues that could go wrong, including the risk that your friend might falsely allege that he ended up compensating you for the website.