Co-written and first recorded by Albert Hammond (1976).
Hit version by Leo Sayer (US #1/UK #1 1977).
From the wiki: “‘When I Need You’ is a popular song written by Albert Hammond (‘It Never Rains in Southern California’, ‘The Air That I Breathe‘) and Carole Bayer Sager (‘A Groovy Kind of Love‘, ‘That’s What Friends Are For’, ‘Theme to Arthur‘). Its first appearance was as the title track of Hammond’s 1976 album When I Need You. Leo Sayer’s version, produced by Richard Perry, was a massive hit worldwide, reaching #1 on the UK Singles Chart for three weeks in February 1977 after three of his earlier singles had stalled at #2. It also reached #1 on both the Billboard Hot 100 for a single week in May 1977 and the Hot Adult Contemporary Tracks.”
Leo Sayer, “When I Need You” (1977):