‘There’s a lot about sex in literature,’ novelist tells Edinburgh international book festival. ‘There’s precious little about rearing children’