Doctor Who star David Tennant has signed up to appear in the final series of Ricky Gervais' TV show Extras.