Angular dependence of the upper critical field in layered superconductors