Hierarchical curl-conforming Nedelec elements for quadrilateral and brick cells