Continuous and discontinuous contact problem of a functionally graded layer resting on a rigid foundation