Thanks for the replies.
I worked out what the issue was in the end. The camera was coming through in the right position and focal length. However, when I changed the size of the render window to match the photograph the focal length of the camera changed. So after fixing the size of the render I went back and changed the focal length back to the original value and it worked perfectly.
Thanks again for your replies.
Andy